package com.yfp.client.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yfp.client.domain.ClientIntegral;
import com.yfp.client.mapper.ClientIntegralMapper;
import com.yfp.client.service.ClientIntegralService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @description 针对表【client_integral(客户积分)】的数据库操作Service实现
 * @createDate 2025-03-05 11:00:35
 */
@Service
public class ClientIntegralServiceImpl extends ServiceImpl<ClientIntegralMapper, ClientIntegral> implements ClientIntegralService {

    @Autowired
    private ClientIntegralMapper clientIntegralMapper;

    @Override
    public List<ClientIntegral> getByClientId(String clientId) {
        return clientIntegralMapper.getByClientId(clientId);
    }

    @Override
    public int sumIntegralByClientId(String clientId) {
        return clientIntegralMapper.sumIntegralByClientId(clientId);
    }

    @Override
    public int insert(ClientIntegral clientIntegral) {
        return clientIntegralMapper.insert(clientIntegral);
    }

    @Override
    public int editStatusByOrderId(String orderId, Integer status) {
        return clientIntegralMapper.editStatusByOrderId(orderId, status);
    }

    @Override
    public ClientIntegral findByOrderId(String orderId) {
        return clientIntegralMapper.findByOrderId(orderId);
    }
}
